#ifndef __DIALOGCHILD_H
#define __DIALOGCHILD_H


#include "..\DuiLib\UIlib.h"
using namespace DuiLib;

#ifdef _DEBUG
#   ifdef _UNICODE
#       pragma comment(lib, "..\\lib\\duilib_ud.lib")
#   else
#       pragma comment(lib, "..\\lib\\duilib_d.lib")
#   endif
#else
#   ifdef _UNICODE
#       pragma comment(lib, "..\\lib\\duilib_u.lib")
#   else
#       pragma comment(lib, "..\\lib\\duilib.lib")
#   endif
#endif



/////////////////



///////////////



class CDlgChild:public CWindowWnd ,public INotifyUI,public IDialogBuilderCallback
{
	CButtonUI* m_pCloseBtn;
	CButtonUI* m_pMaxBtn;
	CButtonUI* m_pRestoreBtn;
	CButtonUI* m_pMinBtn;
	HWND m_hParent;
	void AlignTitleButton(void);
public:
	CPaintManagerUI m_pm;
	CDlgChild(HWND hParent);
	~CDlgChild();
	LPCTSTR GetWindowClassName()const;
	UINT GetClassStyle() const;
	CControlUI* CreateControl(LPCTSTR pstrClass);
	void OnFinalMessage(HWND /*hWnd*/);
	void Init();
	void OnPrepare(void);
	void Notify(TNotifyUI& msg);
	LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnNcActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnNcCalcSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnGetMinMaxInfo(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
	HWND CenterCreate(HWND hwndParent, LPCTSTR pstrName, DWORD dwStyle, DWORD dwExStyle,int cx = CW_USEDEFAULT, int cy = CW_USEDEFAULT, HMENU hMenu = NULL);

	
	LRESULT OnNcLButtonDblClk(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	
};

#endif //__DIALOGCHILD_H
